﻿<template>
  <div>
    <a-card :bordered="false" :bodyStyle="tstyle">

      <div class="table-page-search-wrapper" v-if="hasPerm('OutpBillItems:page')">
        <a-form layout="inline">
          <a-row :gutter="48">
            <a-col :md="8" :sm="24">
              <a-form-item label="">
                <a-input v-model="queryParam.rcptNo" allow-clear placeholder="请输入"/>
              </a-form-item>
            </a-col><a-col :md="8" :sm="24">
              <a-form-item label="">
                <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.operateDatetimeDate" @change="onChangeoperateDatetime"/>
              </a-form-item>
            </a-col><template v-if="advanced">
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.sysClass" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.itemId" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.itemCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.itemName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.itemSpec" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.units" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.itemPrice" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.amount" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.repetition" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.costs" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.charges" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.flag" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.classOnRcpt" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.classOnReckoning" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.subjCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.orderedByCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.doctorCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.performedByCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.orderNo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.printCount" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.patientIdentity" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.payWay" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.payNo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.cancelFlag" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.nameInputCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.patientId" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.patientName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.outpMedicalNo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.registerNo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.patientSex" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.patientFrom" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.orderedBy" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.doctor" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.performedBy" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.feeTypeMask" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.operatorCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.accountFlag" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.cancelReason" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siLevel" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siUnitCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.prescriptCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.visitNo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siVisitFlag" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siItemCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siRate" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siRemark" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siClass" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.icNo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siFeeType" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siAreaCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siType" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siCheckCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siGwyFlag" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siId" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siSendFlag" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siPersonType" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.ybBz" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.ybShbzh" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.remark" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.siRylb" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.rjbz" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.rjsjDate" @change="onChangerjsj"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.amount1" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.accountWay" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.mtInfo" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.operRecord" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.appOrderId" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.appOperDateDate" @change="onChangeappOperDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.billingHospitalCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.confirmHospitalCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.uploadFlag" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.presId" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.printStatus" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.bespokeDocCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.bespokeDocName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.bespokeDeptCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.bespokeDeptName" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-date-picker style="width: 100%" placeholder="请选择" v-model="queryParam.bespokeDateDate" @change="onChangebespokeDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.primaryId" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.packageCode" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.packageOrderNumber" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.rebate" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.rebateMessage" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="">
                  <a-input v-model="queryParam.rebateInfoId" allow-clear placeholder="请输入"/>
                </a-form-item>
              </a-col>            </template>

            <a-col :md="8" :sm="24" >
              <span class="table-page-search-submitButtons">
                <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button>
                <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
                <a @click="toggleAdvanced" style="margin-left: 8px"> {{ advanced ? '收起' : '展开' }}
                  <a-icon :type="advanced ? 'up' : 'down'"/>
                </a>
              </span>
            </a-col>

          </a-row>
        </a-form>
      </div>
    </a-card>
    <a-card :bordered="false">
      <s-table
        ref="table"
        :columns="columns"
        :data="loadData"
        :alert="true"
        :rowKey="(record) => record.iD"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
        <template class="table-operator" slot="operator" v-if="hasPerm('OutpBillItems:add')" >
          <a-button type="primary" v-if="hasPerm('OutpBillItems:add')" icon="plus" @click="$refs.addForm.add()">新增收费</a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a v-if="hasPerm('OutpBillItems:edit')" @click="$refs.editForm.edit(record)">编辑</a>
          <a-divider type="vertical" v-if="hasPerm('OutpBillItems:edit') & hasPerm('OutpBillItems:delete')"/>
          <a-popconfirm v-if="hasPerm('OutpBillItems:delete')" placement="topRight" title="确认删除？" @confirm="() => OutpBillItemsDelete(record)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </s-table>
      <add-form ref="addForm" @ok="handleOk" />
      <edit-form ref="editForm" @ok="handleOk" />
    </a-card>
  </div>
</template>
<script>
  import { STable } from '@/components'
  import moment from 'moment'
  import { OutpBillItemsPage, OutpBillItemsDelete } from '@/api/modular/main/OutpBillItemsManage'
  import addForm from './addForm.vue'
  import editForm from './editForm.vue'
  export default {
    components: {
      STable,
      addForm,
      editForm
    },
    data () {
      return {
        advanced: false, // 高级搜索 展开/关闭
        queryParam: {},
        columns: [
          {
            title: '',
            align: 'center',
            dataIndex: 'rcptNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'sysClass'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'itemId'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'itemCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'itemName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'itemSpec'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'units'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'itemPrice'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'amount'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'repetition'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'costs'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'charges'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'flag'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'classOnRcpt'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'classOnReckoning'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'subjCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'orderedByCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'doctorCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'performedByCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'orderNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'printCount'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'patientIdentity'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'payWay'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'payNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'cancelFlag'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'nameInputCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'patientId'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'patientName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'outpMedicalNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'registerNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'patientSex'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'patientFrom'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'orderedBy'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'doctor'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'performedBy'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'feeTypeMask'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'operatorCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'accountFlag'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'cancelReason'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siLevel'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siUnitCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'prescriptCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'visitNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siVisitFlag'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siItemCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siRate'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siRemark'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siClass'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'icNo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siFeeType'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siAreaCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siType'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siCheckCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siGwyFlag'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siId'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siSendFlag'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siPersonType'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'ybBz'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'ybShbzh'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'remark'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'siRylb'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'rjbz'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'rjsj'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'amount1'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'accountWay'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'mtInfo'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'operRecord'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'appOrderId'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'appOperDate'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'billingHospitalCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'confirmHospitalCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'uploadFlag'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'presId'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'printStatus'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'bespokeDocCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'bespokeDocName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'bespokeDeptCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'bespokeDeptName'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'bespokeDate'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'primaryId'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'packageCode'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'packageOrderNumber'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'rebate'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'rebateMessage'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'rebateInfoId'
          }
        ],
        tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
        // 加载数据方法 必须为 Promise 对象
        loadData: parameter => {
          return OutpBillItemsPage(Object.assign(parameter, this.switchingDate())).then((res) => {
            return res.data
          })
        },
        selectedRowKeys: [],
        selectedRows: []
      }
    },
    created () {
      if (this.hasPerm('OutpBillItems:edit') || this.hasPerm('OutpBillItems:delete')) {
        this.columns.push({
          title: '操作',
          width: '150px',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' }
        })
      }
    },
    methods: {
      moment,
      /**
       * 查询参数组装
       */
      switchingDate () {
        const queryParamoperateDatetime = this.queryParam.operateDatetimeDate
        if (queryParamoperateDatetime != null) {
            this.queryParam.operateDatetime = moment(queryParamoperateDatetime).format('YYYY-MM-DD')
            if (queryParamoperateDatetime.length < 1) {
                delete this.queryParam.operateDatetime
            }
        }
        const queryParamrjsj = this.queryParam.rjsjDate
        if (queryParamrjsj != null) {
            this.queryParam.rjsj = moment(queryParamrjsj).format('YYYY-MM-DD')
            if (queryParamrjsj.length < 1) {
                delete this.queryParam.rjsj
            }
        }
        const queryParamappOperDate = this.queryParam.appOperDateDate
        if (queryParamappOperDate != null) {
            this.queryParam.appOperDate = moment(queryParamappOperDate).format('YYYY-MM-DD')
            if (queryParamappOperDate.length < 1) {
                delete this.queryParam.appOperDate
            }
        }
        const queryParambespokeDate = this.queryParam.bespokeDateDate
        if (queryParambespokeDate != null) {
            this.queryParam.bespokeDate = moment(queryParambespokeDate).format('YYYY-MM-DD')
            if (queryParambespokeDate.length < 1) {
                delete this.queryParam.bespokeDate
            }
        }
        const obj = JSON.parse(JSON.stringify(this.queryParam))
        return obj
      },
      OutpBillItemsDelete (record) {
        OutpBillItemsDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          } else {
            this.$message.error('删除失败') // + res.message
          }
        })
      },
      toggleAdvanced () {
        this.advanced = !this.advanced
      },
      onChangeoperateDatetime(date, dateString) {
        this.operateDatetimeDateString = dateString
      },
      onChangerjsj(date, dateString) {
        this.rjsjDateString = dateString
      },
      onChangeappOperDate(date, dateString) {
        this.appOperDateDateString = dateString
      },
      onChangebespokeDate(date, dateString) {
        this.bespokeDateDateString = dateString
      },
      handleOk () {
        this.$refs.table.refresh()
      },
      onSelectChange (selectedRowKeys, selectedRows) {
        this.selectedRowKeys = selectedRowKeys
        this.selectedRows = selectedRows
      }
    }
  }
</script>
<style lang="less">
  .table-operator {
    margin-bottom: 18px;
  }
  button {
    margin-right: 8px;
  }
</style>
